/* 自定义样式 */
body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    font-family: 'Microsoft YaHei', 'SimHei', Arial, sans-serif;
    min-height: 100vh;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.card {
    border: none;
    border-radius: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

.btn {
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-lg {
    padding: 12px 30px;
    font-size: 1.1rem;
}

.form-control, .form-select {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    transition: border-color 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.table th {
    font-weight: 600;
    border-top: none;
}

.badge {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

.progress {
    height: 10px;
    border-radius: 5px;
}

.progress-bar {
    border-radius: 5px;
}

/* 抽奖结果动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#resultCard {
    animation: fadeInUp 0.6s ease-out;
}

/* 自定义图标样式 */
.fas, .fa {
    margin-right: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .card-body {
        padding: 1.5rem 1rem;
    }
    
    .btn-lg {
        padding: 10px 25px;
        font-size: 1rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
}

/* Loading 动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 状态指示器 */
.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.status-active {
    background-color: #28a745;
    animation: pulse 2s infinite;
}

.status-inactive {
    background-color: #dc3545;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
    
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

/* 表格样式优化 */
.table-responsive {
    border-radius: 10px;
    overflow: hidden;
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: rgba(0,0,0,.02);
}

/* Toast 消息样式 */
.toast {
    border-radius: 10px;
}

/* 特殊效果 */
.lottery-number {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    letter-spacing: 3px;
    background: linear-gradient(45deg, #007bff, #0056b3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.5rem;
    text-shadow: 0 0 20px rgba(0, 123, 255, 0.3);
}

.celebrate {
    animation: celebrate 0.8s ease-in-out;
}

@keyframes celebrate {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Hero card 样式 */
.hero-card {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border: none;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.4s ease;
}

.hero-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.hero-card .card-body {
    padding: 3rem 2rem;
}

/* Icon wrapper */
.icon-wrapper {
    display: inline-block;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

/* 导航栏优化 */
.navbar {
    backdrop-filter: blur(10px);
    background: rgba(13, 110, 253, 0.9) !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.6rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 无导航栏页面优化 */
.no-navbar .container {
    margin-top: 1rem !important;
    padding-top: 1rem;
}

.no-navbar body {
    padding-top: 0;
}

/* 主容器背景 */
.container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    margin-top: 2rem;
    margin-bottom: 2rem;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* 卡片优化 */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

/* 按钮增强 */
.btn {
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn-lg {
    padding: 12px 40px;
    font-size: 1.1rem;
    border-radius: 12px;
}

/* 输入框优化 */
.form-control, .form-select {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(13, 110, 253, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    background: rgba(255, 255, 255, 1);
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    transform: translateY(-1px);
}

/* 进度条美化 */
.progress {
    height: 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
}

/* 表格优化 */
.table {
    background: rgba(255, 255, 255, 0.9);
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Toast 消息优化 */
.toast {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    max-width: 90vw;
    margin: 0 auto;
}

.toast-header {
    font-weight: 600;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.toast-body {
    padding: 0.75rem;
    font-weight: 500;
    line-height: 1.4;
}

/* 加载动画优化 */
.loading {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    width: 24px;
    height: 24px;
}

/* 抽奖结果动画增强 */
#resultCard {
    animation: resultAppear 0.8s ease-out;
}

@keyframes resultAppear {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 移动端优化 */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .container {
        margin: 0.5rem;
        padding: 0.75rem;
        border-radius: 15px;
        min-height: calc(100vh - 1rem);
    }
    
    /* 无导航栏页面的容器优化 */
    .no-navbar .container {
        margin: 0.25rem;
        padding: 0.5rem;
        margin-top: 0.5rem !important;
        padding-top: 0.5rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .card {
        margin-bottom: 1rem;
        border-radius: 12px;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    .hero-card .card-body {
        padding: 1.5rem 1rem;
    }
    
    .icon-wrapper {
        padding: 0.75rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        border-radius: 8px;
    }
    
    .form-control, .form-select {
        padding: 0.75rem;
        font-size: 16px; /* 防止iOS缩放 */
        border-radius: 8px;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    h4 {
        font-size: 1.25rem;
    }
    
    .lottery-number {
        font-size: 2rem;
    }
    
    /* Toast 移动端样式 */
    .toast {
        width: calc(100vw - 2rem);
        max-width: 350px;
        margin: 0 auto;
        font-size: 13px;
    }
    
    .toast-header {
        padding: 0.5rem 0.75rem;
        font-size: 13px;
    }
    
    .toast-body {
        padding: 0.5rem 0.75rem;
        font-size: 13px;
    }
    
    /* 表单间距优化 */
    .mb-3 {
        margin-bottom: 1rem !important;
    }
    
    /* 按钮组间距 */
    .d-grid.gap-2 > * {
        margin-bottom: 0.5rem;
    }
    
    /* 状态卡片优化 */
    .card.shadow.mt-4 {
        margin-top: 1rem !important;
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .container {
        margin: 0.25rem;
        padding: 0.5rem;
    }
    
    /* 无导航栏页面的超小屏优化 */
    .no-navbar .container {
        margin: 0.125rem;
        padding: 0.25rem;
        margin-top: 0.25rem !important;
        padding-top: 0.25rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-lg {
        padding: 0.625rem 1.25rem;
        font-size: 0.95rem;
    }
    
    .form-control, .form-select {
        padding: 0.625rem;
    }
    
    .lottery-number {
        font-size: 1.75rem;
        letter-spacing: 2px;
    }
    
    .navbar {
        padding: 0.5rem 1rem;
    }
    
    .toast {
        width: calc(100vw - 1rem);
        max-width: 320px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }
    
    .card:hover {
        transform: none;
    }
    
    /* 增大触摸区域 */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .form-control, .form-select {
        min-height: 44px;
    }
}

/* 横屏手机优化 */
@media (max-width: 896px) and (orientation: landscape) {
    .container {
        padding: 0.5rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .mb-3 {
        margin-bottom: 0.75rem !important;
    }
}
